<?php
//ajaxdeletebank.php
require_once ("../dao/BankDAO.php");
$action = $_POST['act'];
if($action == 'delbank') {
	$result = false;
	if(isset($_POST['idre'])) {
		$id = $_POST['idre'];
		if(deleteBank($id)) {
			$result = true;
		}
	}
	echo json_encode($result);
} else if($action == 'getbanksdeleted') {
	echo json_encode(getBanks(false));
} else if($action == 'restorebank') {
	$result = false;
	if(isset($_POST['idre'])) {
		$id = $_POST['idre'];
		if(restoreBank($id)) {
			$result = true;
		}
	}
	echo json_encode($result);
} else if($action == 'getbanks') {
	echo json_encode(getBanks(true));
}
?>